package com.social.pojo;

import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * @BelongsProject: social
 * @BelongsPackage: com.social.entity
 * @Author: zhm
 * @CreateTime: 2022-09-26  21:40
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result implements Serializable {


    private Integer status;

    /**
     * 返回结果信息，主要用于页面信息
     */
    private String message;

    /**
     * 返回数据
     */
    private Object data;

    private Object errorMessage;

    public static final Result ok(Integer status){return new Result(status,null, null,null);}
    public static final Result ok(Integer status, Object data){return new Result(status,null, data,null);}
    public static final Result fail(Integer status, String message){return new Result(status,message,null,null);}
    public static final Result fail(Integer status, Object errorMessage){return new Result(status,null,null,errorMessage);}
}
